/*
 * @lc app=leetcode.cn id=728 lang=typescript
 *
 * [728] 自除数
 */

// @lc code=start
function selfDividingNumbers(left: number, right: number): number[] {
    let sum: number[] = [];
    for (let i = left; i < right + 1; i++) {
        const isOK = i
            .toString()
            .split("")
            .every((el) => {
                return i % parseInt(el) === 0;
            });
        if (isOK) sum.push(i);
    }
    return sum;
}
// @lc code=end
